Using Darren Fergusons feedcache in conjunction with Warren Buckleys twitter for Umbraco (excellent packages) - I'm altering the TwitterStatus.xslt to get the xml from the cached xml file and not twitter directly - see code below.
I'm editing the file directly in Umbraco back office - it fails to save using the above code & throws a System.UriFormatException: Invalid URI: The URI is empty.
I've tried
<xsl:variable name="twitterXMLUrl" select="document('../App_Data/FeedCache/mywitter.xml')"/> still doesn't work.
<xsl:variable name="twitterXmlUrl select="'../App_Data/FeedCache/mytwitter.xml'" /> - It's probably a bit hard to see that the single quotes are still in there. You could also do this <xsl:variable name="twitterXmlUrl" select="string(../App_Data/FeedCache/mytwitter.xml)" /> - This is probably easier to read.
Hope this helps.
Regarding a good XSLT source I think you should have a look at http://pimpmyxslt.com/articles/ - it's written by Chriztian Steinmeier who is a XSLT wizard and he is often helping people out with XSLT in these forums as well. The articles are written with Umbraco as context.
Unexpected token '[' in the expression
Using Darren Fergusons feedcache in conjunction with Warren Buckleys twitter for Umbraco (excellent packages) - I'm altering the TwitterStatus.xslt to get the xml from the cached xml file and not twitter directly - see code below.
however i get the error - Unexpected token '[' in the expression......
I'm a bit of a xslt newbie - what is the best way to select an xml file with xsl variable?
Many Thanks
Hi sd7
Remove the square brackets [] and you should be fine.
Hope this helps.
/Jan
Cheers for quick post Jan
I've tried this
<xsl:variable name="twitterXMLUrl" select="../App_Data/FeedCache/mywitter.xml"/>
I'm editing the file directly in Umbraco back office - it fails to save using the above code & throws a System.UriFormatException: Invalid URI: The URI is empty.
I've tried
<xsl:variable name="twitterXMLUrl" select="document('../App_Data/FeedCache/mywitter.xml')"/> still doesn't work.
I really need to get a decent book on xslt!
Cheers
His sd75
You removed more than I told you to do :)
<xsl:variable name="twitterXmlUrl select="'../App_Data/FeedCache/mytwitter.xml'" /> - It's probably a bit hard to see that the single quotes are still in there. You could also do this <xsl:variable name="twitterXmlUrl" select="string(../App_Data/FeedCache/mytwitter.xml)" /> - This is probably easier to read.
Hope this helps.
Regarding a good XSLT source I think you should have a look at http://pimpmyxslt.com/articles/ - it's written by Chriztian Steinmeier who is a XSLT wizard and he is often helping people out with XSLT in these forums as well. The articles are written with Umbraco as context.
Hope this helps.
/Jan
Many Thanks Jan - I'll have a look.
On the twitter cache front - I've replaced the following code from the twitter package:-
<xsl:variable name="twitterXMLUrl" select="concat('http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=', $twitterUsername ,'&include_rts=', $displayNativeRTs ,'&exclude_replies=', $excludeReplies, '&include_entities=1&count=', $noStatus)"/>
<!-- Go fetch the tweets & cache for 60 seconds -->
<xsl:for-each select="umbraco.library:GetXmlDocumentByUrl($twitterXMLUrl,'60')//statuses/status">
<xsl:apply-templates mode="tweet" select="current()"/>
</xsl:for-each>
with this
<xsl:variable name="twitterXMLUrl" select="string(../App_Data/FeedCache/mytwitter.xml)" />
<xsl:for-each select="document($twitterXMLUrl)//statuses/status">
<xsl:apply-templates mode="tweet" select="current()"/>
</xsl:for-each>
but back office fails to save the document.
Hi sd75,
Even if you use the string() function, you still need to include the single quotes – so try this:
/Chriztian
Many Thanks Chriztian - all good!
is working on a reply...